<?php
require (dirname(__FILE__) . "/../repository/widgetPool/config.php");
if(! defined("IS_LOAD_INC_CONFIG")){
    define("IS_LOAD_INC_CONFIG", true); // integrate with product
    //initial class WF
    require_once dirname(__FILE__) . '/class/init.php';
    // set php error to exception
    require_once (dirname(__FILE__) . '/class/common/exception/ErrorHandlerException.php');
    set_error_handler(array("WFErrorHandlerException", "errorHandlerCallback"), E_ALL);
}
/*
     * TO PRODUCT TEAMS:
     * This file would be updated in the future. Don't change following
     * configurations directly. If you need to change settings, please
     * reassign those variables in WP_HOME/inc/config.php
     */
/*
        Below is diagnostic log configurations
        $GLOBALS['wfconf_debug'] = true; //wfconf_debug_level = DEBUG
        $GLOBALS['wfconf_debug'] = false; //wfconf_debug_level = INFO
        $GLOBALS['wfconf_debug'] = 'null'; //turn off diagnostic.log
        */
$GLOBALS['scm_path'] = dirname(__FILE__) . '/../../SCMUpdate/';
$GLOBALS['wfconf_debug'] = false;
$GLOBALS['wfconf_debug_type'] = "log";
$GLOBALS['wfconf_debug_dir'] = dirname(__FILE__) . '/../repository/log/';
$GLOBALS['wfconf_debug_logname'] = "diagnostic";
$GLOBALS['wfconf_debug_size'] = "10MB";
$GLOBALS['wfconf_debug_backup'] = "5";
// log for php /path/to/interface_request.php upgradeWF.php
$GLOBALS['wfconf_upgradeWF_debug_logname'] = "upgradeWF";
/*
        Below is diagnostic log configurations
        six level: OFF/FATAL/ERROR/WARN/INFO/DEBUG
        $GLOBALS['wfconf_client_debug_level'] = "OFF";  //turn off
        */
$GLOBALS['wfconf_client_debug_level'] = "OFF";
$GLOBALS['wfconf_client_debug_type'] = "log";
$GLOBALS['wfconf_client_debug_dir'] = dirname(__FILE__) . '/../repository/log/';
$GLOBALS['wfconf_client_debug_logname'] = "client_diagnostic";
$GLOBALS['wfconf_client_debug_size'] = "10MB";
$GLOBALS['wfconf_client_debug_backup'] = "5";
$GLOBALS['wfconf_client_debug_max_stack_size'] = "2000";
$GLOBALS['wfconf_client_debug_console'] = false;
$GLOBALS['wfconf_client_debug_console_debugger_userIds'] = "1"; //use "," to seperate userId
$GLOBALS['wfconf_client_debug_window_onerror'] = true;
/* *********************************************************
     * Basic configurations
     */
// Notice: $wfconf_version only support minor version, please don't input build version
// Please don't input [alpha / beta] word in the end of $wfconf_version. EX : 2.0 alpha
$wfconf_version = "3.5"; // used for browser title, wf email sender name in modLogin, widget_min_wf_version compare
$wfconf_sitename = "Trend Micro Widget Framework " . $wfconf_version;
$wfconf_WFHome = realpath(dirname(__FILE__) . "/..");
/* *********************************************************
     * Database configurations
     */
$wfconf_dbconfig = array();
// Type
$wfconf_dbconfig["type"] = "sqlite"; // sqlite or mysql
// Settings for MySQL
$wfconf_dbconfig["host"] = "localhost";
$wfconf_dbconfig["username"] = "root";
$wfconf_dbconfig["password"] = "root@trendmicro";
// Settings for SQLite
if(WF::isUnitTest()){
    $wfconf_dbconfig["dbname"] = "tmwf_test";
    $wfconf_dbconfig["dbfile"] = $wfconf_WFHome . "/repository/db/sqlite/tmwf_test.db"; // database file
}else{
    $wfconf_dbconfig["dbname"] = "tmwf";
    $wfconf_dbconfig["dbfile"] = $wfconf_WFHome . "/repository/db/sqlite/tmwf.db"; // database file
}
require (dirname(__FILE__) . "/schema.php");
// Database handler
$wfconf_handler_db = "db_controller.php";
// default user data
$wfconf_default_user_cdata = '[';
$wfconf_default_user_cdata .= '{"container_id":1,"container_name":"dashBoard","container_param":{"serverList":true,"help":true,"tabSettings":true,"addWidgets":true,"tab":true,"addTab":true},"container_type_name":"dashBoard"},';
$wfconf_default_user_cdata .= '{"container_id":2,"container_name":"updateConfigureWidgetAndWidgetComponent","container_param":{"serverList":false,"help":false,"tabSettings":false,"addWidgets":false,"tab":false,"addTab":false},"container_type_name":"updateConfigureWidgetAndWidgetComponent"}';
$wfconf_default_user_cdata .= ']';
$wfconf_default_user_udata = '';
$wfconf_default_user_pdata = '[';
$wfconf_default_user_pdata .= '{"sqeuenceNumber":1,"pageName":"updateConfigureWidgetAndWidgetComponent","layout":"1","pageNumber":1,"boxWidth":"","autoFit":0,"container_id":2},';
$wfconf_default_user_pdata .= '{"sqeuenceNumber":1,"pageName":"Page_1","layout":"1","pageNumber":2,"boxWidth":"","autoFit":0,"isSlideShow":1,"intIntervalSlideShow":10,"container_id":1}';
$wfconf_default_user_pdata .= ']';
//$wfconf_default_userdata = "";
$wfconf_default_user_lang = "en_US";
$wfconf_default_user_theme = "default";
/* *********************************************************
     * Encryption module configurations
     */
$wfconf_wfcrypt_keyfile = dirname(__FILE__) . "/../repository/inc/class/common/crypt/crypt.key";
$wfconf_wfcrypt_algorithm = MCRYPT_RIJNDAEL_256; // MCRYPT_3DES MCRYPT_BLOWFISH MCRYPT_CAST_256 MCRYPT_DES ...
/* *********************************************************
     * Framework configurations
     */
// calculate base url
if(isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI'])){
    if(isset($_SERVER['HTTPS'])){
        if($_SERVER['HTTPS'] == "off")
            $wfconf_base = "http://";
        else
            $wfconf_base = "https://";
    }else
        $wfconf_base = "http://";
    $wfconf_base = $wfconf_base . $_SERVER['HTTP_HOST'] . substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], "/") + 1);
}
// directory definitions
$wfconf_dir_modules = WP_WEBROOT_NO_SLASH . "/widget";
$wfconf_dir_lang = WP_WEBROOT_NO_SLASH . "/lang";
$wfconf_dir_tmpwidget = "/tmp";
//$wfconf_dir_javascript = "javascript"; // unused
/* *********************************************************
     * Proxy Request module configurations
     */
$wfconf_handler_ProxyRequest = "proxy_controller.php";
// load compact or normal version js
$wfconf_js_compact = true;
$wfconf_widget_compact = true;
$wfconf_product_logon_page = "/WebApp/Login.aspx";
// Define the product NS
$wfconf_product_ns = "http://www.trendmicro.com/widget_framework";
$GLOBALS["wfconf_cacheDir"] = $wfconf_WFHome . "/repository/cache";
$GLOBALS["wfconf_default_menu"] = true;
$GLOBALS["wfconf_lang_mapping"] = array('en_US' => 'en_US', 'zh_TW' => 'zh_TW', 'zh_CN' => 'zh_CN', 'de_DE' => 'de_DE', 'es_ES' => 'es_ES', 'fr_FR' => 'fr_FR', 'ja_JP' => 'ja_JP', 'ko_KR' => 'ko_KR', 'pl_PL' => 'pl_PL', 'ru_RU' => 'ru_RU', 'it_IT' => 'it_IT');
$GLOBALS["wfconf_use_jquery"] = false;
/* *********************************************************
          * all variables can be reset in WP_HOME/inc/config.php
     */
require (dirname(__FILE__) . '/include_wp_home_config.php');
// check be defined already
if(! defined("STANDALONE_WF")){
    define("STANDALONE_WF", true); // standalone widget framework
}
if(! defined('UI_DIR')){
    define("UI_DIR", "ui");
}
if(! defined('PROXY_DIR')){
    define("PROXY_DIR", WP_HOME . "/proxy");
}
if(! defined('USER_GENERATED_WIDGET_DIR')){
    define("USER_GENERATED_WIDGET_DIR", "repository/userGenerated/widget");
}
if(! defined('USER_GENERATED_PROXY_DIR')){
    define("USER_GENERATED_PROXY_DIR", "repository/userGenerated/proxy");
}
//Define how many days to show new on add widgets page
//If you change this value, please synchronize this value in repository/widgetPool/wpCurrent/js/pageSettings.js
$wfconf_shownew_days = '14';
$GLOBALS["wfconf_repositoryDir"] = "repository";

//whether using scm and widget pool update
$GLOBALS['wfconf_scm_and_widget_pool_update'] = true;